﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
	<title>学生管理</title>
	<%@ include file= "_meta.jsp"%>
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.2.1.min.js"></script>
	<%--<link rel="stylesheet" type="text/css" href="http://www.java1234.com/jquery-easyui-1.3.3/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="http://www.java1234.com/jquery-easyui-1.3.3/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="http://www.java1234.com/jquery-easyui-1.3.3/demo/demo.css">
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" src="http://www.java1234.com/jquery-easyui-1.3.3/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="http://www.java1234.com/jquery-easyui-1.3.3/locale/easyui-lang-zh_CN.js"></script>--%>
</head>
<body>
<!--_header 作为公共模版分离出去-->
<%@ include file= "_header.jsp"%>
<%@ include file= "_menu.jsp"%>

<div class="dislpayArrow hidden-xs"><a class="pngfix" href="javascript:void(0);" onClick="displaynavbar(this)"></a></div>
<!--/_menu 作为公共模版分离出去-->

<section class="Hui-article-box">
	<div class="Hui-article">
		<%--<div class="pos-a" style="width:150px;left:0;top:0; bottom:0; height:100%; border-right:1px solid #e5e5e5; background-color:#f5f5f5">
			<ul id="treeDemo" class="ztree">
			</ul>
		</div>--%>
		<div>
			<div class="pd-20">
				<%--<div class="text-c"> 日期范围：
					<input type="text" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'logmax\')||\'%y-%M-%d\'}'})" id="logmin" class="input-text Wdate" style="width:120px;">
					-
					<input type="text" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'logmin\')}',maxDate:'%y-%M-%d'})" id="logmax" class="input-text Wdate" style="width:120px;">
					<input type="text" name="" id="" placeholder=" 产品名称" style="width:250px" class="input-text">
					<button name="" id="" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜产品</button>
				</div>--%>
					<div class="cl pd-5 bg-1 bk-gray mt-20"><span class="l"><a  class="btn btn-danger radius" id="btn_delete"><i
							class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> <a class="btn btn-primary radius"

																		  href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 添加学生</a></span>
						<span class="r">共有数据：<strong>${fn:length(students)}</strong> 条</span></div>
					<div class="mt-20">
					<table class="table table-border table-bordered table-bg table-hover table-sort">
						<thead>

							<tr>
								<th><input type="checkbox" name="" value=""></th>
								<th>学号</th>
								<th>姓名</th>
								<th>专业</th>
								<th>入学时间</th>
								<th> 最大选课数量</th>
								<th>性别</th>
								<th>生日</th>
								<th>电话</th>

								<th width="100">重置密码</th>
							</tr>
						</thead>
						<tbody>

						<c:forEach var="student" items="${students}" varStatus="outStatus">
							<tr row="${outStatus.index}" class="symbol">
								<td><input type="checkbox" class="sid" sid="${student.sid}"/></td>
								<td>
									<input type="text" class="table_in_input" readonly='true' value="${student.sid}"/>

								</td>
								<td>
									<input type="text" class="table_in_input" readonly='true' value="${student.sname}"/>
								</td>
								<td>
									<select class="mcb">
										<c:forEach var="major" items="${majors}" varStatus="trow">
											<c:choose>
												<c:when test="${student.major.major_id==major.major_id}">
													<option selected value="${major.major_name}" major_id="${major.major_id}">${major.major_name}</option>
												</c:when>
												<c:otherwise>
													<option value="${major.major_name}" major_id="${major.major_id}">${major.major_name}</option>
												</c:otherwise>
											</c:choose>
										</c:forEach>
									</select>
								</td>

								<td>
									<%--<input class="easyui-datebox table_in_input" required value="${student.to_school_time}"/>--%>
									<input type="text" onfocus="WdatePicker({dchanging:function(){sendReq(this)}})"
										   value="${student.birthday}"  class="table_in_input input-text Wdate">
								</td>

								<td>
									<input  class='table_in_input' readonly='true' style="width: 100px" value="${student.max_num}"/>
								</td>
								<td>
									<select class="scb">
										<c:forEach var="sex" items="男,女" varStatus="trow">
											<c:choose>
												<c:when test="${student.sex==sex}">
													<option selected value="女">女</option>
												</c:when>
												<c:otherwise>
													<option selected value="男">男</option>
												</c:otherwise>
											</c:choose>
										</c:forEach>

									</select>

								</td>
								<td>
									<input type="text" onfocus="WdatePicker({dchanging:function(){sendReq(this)}})"
										   value="${student.birthday}" class="table_in_input input-text Wdate">
									<%--<input class="easyui-datebox table_in_input"  required value="${student.birthday}"/>--%>

								</td>
								<td>
									<input type="text" class="table_in_input" readonly='true' value="${student.stel} "/>
								</td>

								<td><input type="button" class="rest_psw" sid="${student.sid}" value="重置密码"/></td>
							</tr>
						</c:forEach>
						</tbody>
					</table>
				</div>
			</div>
		</div>

	</div>
</section>
<!--_footer 作为公共模版分离出去-->
<%@ include file= "_footer.jsp"%>
<script type="text/javascript">
var setting = {
	view: {
		dblClickExpand: false,
		showLine: false,
		selectedMulti: false
	},
	data: {
		simpleData: {
			enable:true,
			idKey: "id",
			pIdKey: "pId",
			rootPId: ""
		}
	},
	callback: {
		beforeClick: function(treeId, treeNode) {
			var zTree = $.fn.zTree.getZTreeObj("tree");
			if (treeNode.isParent) {
				zTree.expandNode(treeNode);
				return false;
			} else {
				demoIframe.attr("src",treeNode.file + ".html");
				return true;
			}
		}
	}
};

var zNodes =[
	{ id:1, pId:0, name:"一级分类", open:true},
	{ id:11, pId:1, name:"二级分类"},
	{ id:111, pId:11, name:"三级分类"},
	{ id:112, pId:11, name:"三级分类"},
	{ id:113, pId:11, name:"三级分类"},
	{ id:114, pId:11, name:"三级分类"},
	{ id:115, pId:11, name:"三级分类"},
	{ id:12, pId:1, name:"二级分类 1-2"},
	{ id:121, pId:12, name:"三级分类 1-2-1"},
	{ id:122, pId:12, name:"三级分类 1-2-2"},
];

var code;

function showCode(str) {
	if (!code) code = $("#code");
	code.empty();
	code.append("<li>"+str+"</li>");
}

$(document).ready(function(){
	var t = $("#treeDemo");
	t = $.fn.zTree.init(t, setting, zNodes);
	demoIframe = $("#testIframe");
	//demoIframe.bind("load", loadReady);
	var zTree = $.fn.zTree.getZTreeObj("tree");
	//zTree.selectNode(zTree.getNodeByParam("id",'11'));
});

$('.table-sort').dataTable({
	"aaSorting": [[1, "desc"]],//默认第几个排序
	"bStateSave": true,//状态保存
	"aoColumnDefs": [
	  {"orderable":false,"aTargets":[0,6]}// 制定列不参与排序
	]
});
/*图片-添加*/
function product_add(title,url){
	var index = layer.open({
		type: 2,
		title: title,
		content: url
	});
	layer.full(index);
}
/*图片-查看*/
function product_show(title,url,id){
	var index = layer.open({
		type: 2,
		title: title,
		content: url
	});
	layer.full(index);
}
/*图片-审核*/
function product_shenhe(obj,id){
	layer.confirm('审核文章？', {
		btn: ['通过','不通过'],
		shade: false
	},
	function(){
		$(obj).parents("tr").find(".td-manage").prepend('<a class="c-primary" onClick="product_start(this,id)" href="javascript:;" title="申请上线">申请上线</a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已发布</span>');
		$(obj).remove();
		layer.msg('已发布', {icon:6,time:1000});
	},
	function(){
		$(obj).parents("tr").find(".td-manage").prepend('<a class="c-primary" onClick="product_shenqing(this,id)" href="javascript:;" title="申请上线">申请上线</a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-danger radius">未通过</span>');
		$(obj).remove();
    	layer.msg('未通过', {icon:5,time:1000});
	});
}
/*图片-下架*/
function product_stop(obj,id){
	layer.confirm('确认要下架吗？',function(index){
		$(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="product_start(this,id)" href="javascript:;" title="发布"><i class="Hui-iconfont">&#xe603;</i></a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-defaunt radius">已下架</span>');
		$(obj).remove();
		layer.msg('已下架!',{icon: 5,time:1000});
	});
}

/*图片-发布*/
function product_start(obj,id){
	layer.confirm('确认要发布吗？',function(index){
		$(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="product_stop(this,id)" href="javascript:;" title="下架"><i class="Hui-iconfont">&#xe6de;</i></a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已发布</span>');
		$(obj).remove();
		layer.msg('已发布!',{icon: 6,time:1000});
	});
}
/*图片-申请上线*/
function product_shenqing(obj,id){
	$(obj).parents("tr").find(".td-status").html('<span class="label label-default radius">待审核</span>');
	$(obj).parents("tr").find(".td-manage").html("");
	layer.msg('已提交申请，耐心等待审核!', {icon: 1,time:2000});
}
/*图片-编辑*/
function product_edit(title,url,id){
	var index = layer.open({
		type: 2,
		title: title,
		content: url
	});
	layer.full(index);
}
/*图片-删除*/
function product_del(obj,id){
	layer.confirm('确认要删除吗？',function(index){
		$(obj).parents("tr").remove();
		layer.msg('已删除!',{icon:1,time:1000});
	});
}
</script>
<script src="${pageContext.request.contextPath}/js/myjs/list_student.js"></script>
<%--
<script type="text/javascript" src="${pageContext.request.contextPath}/lib/My97DatePicker/4.8/WdatePicker.js"></script>
--%>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>